package org.sharing.design.strategy.onStrategy;

import java.math.BigDecimal;

/**
 * @author: Dragon
 * @since: 2024/4/6 16:11
 * 优惠类型上下文
 */
public class Context<T> {

    private ICouponDiscount<T> couponDiscount;

    public Context(ICouponDiscount<T> couponDiscount) {
        this.couponDiscount = couponDiscount;
    }

    public BigDecimal discountAmount(T couponInfo, BigDecimal price) {
        return couponDiscount.discountAmount(couponInfo, price);
    }
}
